[IA64] tak emulation, minor 4k-page correction
authorAlex Williamson <alex.williamson@hp.com>
Tue, 11 Sep 2007 21:12:39 +0000 (15:12 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Tue, 11 Sep 2007 21:12:39 +0000 (15:12 -0600)
Signed-off-by: Juergen Gross juergen.gross@fujitsu-siemens.com
xen/arch/ia64/xen/mm.c
xen/arch/ia64/xen/vcpu.c

index f5a4123a4906e4f6005b4208154b5ad0ffe9f08d..cccc9329a15fa69ffea555546baeeb9a7796ffae 100644 (file)
@@ -527,7 +527,7 @@ u64 translate_domain_pte(u64 pteval, u64 address, u64 itir__, u64* itir,
 
        pteval2 = lookup_domain_mpa(d, mpaddr, entry);
        if (ps < PAGE_SHIFT)
-               pteval2 |= address & (PAGE_SIZE - 1) & ~((1L << ps) - 1);
+               pteval2 |= mpaddr & (PAGE_SIZE - 1) & ~((1L << ps) - 1);
 
        /* Check access rights.  */
        arflags  = pteval  & _PAGE_AR_MASK;
index 560660d44c37bd7db900aa91cb81f7acd5318226..ea7a922dd6804b5f19b8efd6010957427ad3f8b8 100644 (file)
@@ -1817,10 +1817,16 @@ IA64FAULT vcpu_tpa(VCPU * vcpu, u64 vadr, u64 * padr)
 
 IA64FAULT vcpu_tak(VCPU * vcpu, u64 vadr, u64 * key)
 {
-       printk("vcpu_tak: tak instruction unsupported\n");
-       return IA64_ILLOP_FAULT;
-       // HACK ALERT: tak does a thash for now
-       //return vcpu_thash(vcpu,vadr,key);
+       u64 pteval, itir, mask, iha;
+       IA64FAULT fault;
+
+       fault = vcpu_translate(vcpu, vadr, TRUE, &pteval, &itir, &iha);
+       if (fault == IA64_NO_FAULT || fault == IA64_USE_TLB)
+               *key = itir & IA64_ITIR_KEY_MASK;
+       else
+               *key = 1;
+
+       return IA64_NO_FAULT;
 }
 
 /**************************************************************************